{extends file="backend/index.tpl"}
{block name="page-content"}

<div class="page-header">
    <div class="icon">
        <span class="ico-pen-2"></span>
    </div>
    <h1>DANH MỤC <small>QUẢN LÝ DANH MỤC TRUYỆN</small></h1>
</div>

<div class="row-fluid">
    <div class="span12">
        <div class="block">
            <div class="btn-group" data-toggle="buttons-checkbox">
                <table>
                    <tr>
                        <td>
                            <form method="POST" action="{$base_url}admin/add-category.html">
                                <button type="submit" class="btn btn-warning" >Thêm Truyện Mới</button>
                            </form>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="head dblue">
                <div class="icon"><span class="ico-layout-9"></span></div>
                <h2>List Category</h2>
                <ul class="buttons">
                    <li><a href="#" onClick="source('table_sort_pagination'); return false;">
                        <div class="icon"><span class="ico-info"></span></div>
                    </a></li>
                </ul>
            </div>
            <div class="data-fluid">
                <table class="table lcnp" id="listGame" cellpadding="0" cellspacing="0" width="100%">
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th>Name</th>
                            <th>Unique Name</th>
                            <th>Display</th>
                            <th>Page Title</th>
                            <th>Type</th>
                            <th class="TAC">Actions</th>
                        </tr>
                    </thead>
                    <tbody>
                    {foreach from=$listCategory item=category}
                        <tr class="edit_tr">
                            <td width="5%">{$category.id}</td>
                            <td width="10%">{$category.name}</td>
                            <td width="10%">{$category.uname}</td>
                            <td width="10%">{$category.display}</td>
                            <td width="25%">{$category.page_title}</td>
                            <td width="4%">{if $category.type eq 'T'}<span style='color:blue;'>Translate</span>{else}<span style='color:red;'>Convert</span>{/if}</td>
                            <td width="6%">
                                <a href="{$base_url}admin/update-category/{$category.uname}.html" class="button green">
                                    <div class="icon"><span class="ico-pencil"></span></div>
                                </a>
                                <a href="{$base_url}admin/delete-category/{$category.id}" class="button red" onclick="return confirm('Bạn có muốn xóa tiếp không?')">
                                    <div class="icon"><span class="ico-remove"></span></div>
                                </a>
                            </td>
                        </tr>
                    {/foreach}
                    </tbody>
                </table>
            </div>
            <div class="pagination" style="text-align:center;">  
                {$pageList}  
              </div>
        </div>
    </div>
</div>

{/block}
